package com.relax.mybatis.annotation;

import java.lang.annotation.*;

import com.relax.mybatis.constant.SensitiveType;

/**
 * @author relax
 * @date 2022/07/05
 * @desc 标记需要脱敏的json字段对应的map key
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface SensitiveJSONFieldKey {

    String value();

    /**
     * 脱敏类型
     * 
     * @return SensitiveType
     * @see com.relax.mybatis.constant.SensitiveType
     */
    String type() default SensitiveType.DEFAUL;

    /**
     * 占位符
     *
     * @return
     */
    String symbol() default "";

    /**
     * 是通过写入脱敏，默认true
     *
     * @return
     */
    boolean withWrite() default true;

}
